package com.wisezone.workflow.dao.ibatis;

import java.util.List;

import com.wisezone.common.dao.impl.BaseDaoImpl;
import com.wisezone.workflow.bean.WfActivityInstUser;
import com.wisezone.workflow.bean.WfActivityInstance;
import com.wisezone.workflow.bean.form.WfActivityInstUserForm;
import com.wisezone.workflow.bean.search.WfActivityInstUserSearch;
import com.wisezone.workflow.dao.WfActivityInstUserDao;
import com.wisezone.workflow.exception.WfDaoException;

/**
 * IBATIS 活动用户实现类
 * @author tss 2009-09-05
 * 
 */
public class WfActivityInstUserDaoImpl extends BaseDaoImpl implements WfActivityInstUserDao {

    public WfActivityInstUserDaoImpl() {
        super();
    }


    /**
     * 删除未参与活动的记录
     * @param ai
     * @throws WfDaoException
     */
    public void deleteOhter(WfActivityInstance ai) throws WfDaoException {
    	
    	this.execute("deleteOther",ai);
    	this.execute("deleteOtherGroup",ai);
    }
    
    /**
     * 根据流程实例Id 和 用户ID 逻辑删除
     * @param processInstId
     * @param userId
     * @throws WfDaoException
     */
    public void logicDel(Long processInstId,Long userId) throws WfDaoException{
    	
    	WfActivityInstUserSearch searchEntity = new WfActivityInstUserSearch();
    	searchEntity.setProcessInstId(processInstId);
    	searchEntity.setUserId(userId);
    	this.execute("logicDel", searchEntity);
    }
    
    
    
    /**
     * 获得活动和人员列表
     * @param activityInstId
     * @return
     * @throws WfDaoException
     */
    public List<WfActivityInstUser> listByActivityInstId(Long activityInstId) throws WfDaoException{
    	
    	WfActivityInstUserSearch searchEntity = new WfActivityInstUserSearch();
    	searchEntity.setActivityInstId(activityInstId);
    	return this.listAll(searchEntity);
    	
    }
    
    /**
     * 获得活动和人员表单列表
     * @param activityInstId
     * @return
     * @throws WfDaoException
     */
    public List<WfActivityInstUserForm> listFormByActivityInstId(Long activityInstId) throws WfDaoException{
    	
    	WfActivityInstUserSearch searchEntity = new WfActivityInstUserSearch();
    	searchEntity.setActivityInstId(activityInstId);
    	return this.listFormAll(searchEntity);
    	
    }
    

   
   

   
}